package com.uzai.common.enums;

/**
 * 群发消息来源
 * @Auther: liuqi
 * @Date: 2021/8/19 11:22
 * @Description:
 */
public enum GroupSendSourceEnum {
    WECHAT_USER(1,"个人微信用户"),
    WORK_USER(2,"企业微信用户"),
    WECHAT_CONTACTS(3,"个人微信通信录"),
    WORK_CONTACTS(4,"企业微信通讯录");

    private Integer value;
    private String desc;

    GroupSendSourceEnum(Integer value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public Integer getValue() {
        return value;
    }

    public void setValue(Integer value) {
        this.value = value;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public static GroupSendSourceEnum getById(Integer id) {
        if (id == null) {
            return null;
        }
        for (GroupSendSourceEnum type: GroupSendSourceEnum.values()) {
            if (type.getValue().intValue() == id) {
                return type;
            }
        }
        return null;
    }
}
